<template>
  <div>
    <MessageWinComponent ref="message-ref"/>
    <ToolBarComponent ref="test-content-bar">
      <InputComponent input-lable="总分" input-name="totalScore" input-type="Number"/>
      <InputComponent input-lable="偏差" input-name="drift" input-type="Number"/>
      <Button text="生成" :click-function="submit"/>
      <table>
        <p style="text-align:center ">出题维度</p>
        <tr>
          <td>题型</td>
          <td>难度</td>
          <td>模块</td>
        </tr>
        <tr>
          <td><InputComponent input-lable="选择" input-name="type.signle" input-type="Number"/></td>
          <td><InputComponent input-lable="入职" input-name="level.induction" input-type="Number"/></td>
          <td><InputComponent input-lable="承兑" input-name="moduel.moduel_01" input-type="Number"/></td>
        </tr>
        <tr>
          <td><InputComponent input-lable="多选" input-name="type.multi" input-type="Number"/></td>
          <td><InputComponent input-lable="简单" input-name="level.simple" input-type="Number"/></td>
          <td><InputComponent input-lable="贴现" input-name="moduel.moduel_02" input-type="Number"/></td>
        </tr>
        <tr>
          <td><InputComponent input-lable="填空" input-name="type.blank" input-type="Number"/></td>
          <td><InputComponent input-lable="一般" input-name="level.commonly" input-type="Number"/></td>
          <td><InputComponent input-lable="质押" input-name="moduel.moduel_03" input-type="Number"/></td>
        </tr>
        <tr>
          <td><InputComponent input-lable="判断" input-name="type.judge" input-type="Number"/></td>
          <td></td>
          <td><InputComponent input-lable="解质押" input-name="moduel.moduel_04" input-type="Number"/></td>
        </tr>
        <tr>
          <td><InputComponent input-lable="简答" input-name="type.answer" input-type="Number"/></td>
          <td></td>
          <td><InputComponent input-lable="票据池" input-name="moduel.moduel_05" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="提示付款" input-name="moduel.moduel_06" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="解付" input-name="moduel.moduel_07" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="追索" input-name="moduel.moduel_08" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="市场交易" input-name="moduel.moduel_09" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="背书" input-name="moduel.moduel_10" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="保证" input-name="moduel.moduel_11" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="估值" input-name="moduel.moduel_12" input-type="Number"/></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td><InputComponent input-lable="营改增" input-name="moduel.moduel_13" input-type="Number"/></td>
        </tr>
      </table>
      <div style="padding-bottom:15px">
      </div>
    </ToolBarComponent>
    <Button text="生成" :click-function="submit"/>
  </div>
</template>

<script>
import ToolBarComponent from "@/components/toolbar/ToolBarComponent";
import Button from "@/components/button/ButtonComponent";
import InputComponent from "@/components/input/InputComponent";
import {postRequest} from "@/axio2";
import MessageWinComponent from "@/components/win/MessageWinComponent";

export default {
  name: "ExportTestQuestion",
  data(){
    return{
    }
  },
  methods:{
    submit(){
      let param = this.$refs["test-content-bar"].getSubmitNotNullParams();
      postRequest(
          "testManage/randomTopicGeneration.do",
          param,
          this.successCallback,
          this.failCallback,
          this
      );
    },
    successCallback(resp,component){
      let data = resp.data.resultData;
      component.$refs["message-ref"].setMessage(data);
      component.$refs["message-ref"].showWin();
    },
    failCallback(resp,component){
      component.$refs["message-ref"].setMessage(resp.data.errorMsg);
      component.$refs["message-ref"].showWin();
    }
  },

  components: {
    MessageWinComponent,
    InputComponent, Button, ToolBarComponent}
}
</script>

<style scoped>
  body {
    width:340px;
    height:800px;
  }
  table {
    border-collapse :collapse;
  }

  th,td {
    width:100px;
    height:40px;
    border :1px solid black;
    font-size:12px;
    text-align :center;
  }
</style>